package com.baturu.mybatisminus.enums;

import org.apache.ibatis.mapping.SqlCommandType;

/**
 * @author huangbin
 */
public enum QueryType {
    SELECT("SELECT %s FROM %s WHERE %s ", SqlCommandType.SELECT),
    COUNT("SELECT COUNT(%s) FROM %s WHERE %s ", SqlCommandType.SELECT),
    DELETE("DELETE FROM %s WHERE %s ", SqlCommandType.DELETE),
    UPDATE("UPDATE %s SET %s WHERE %s ", SqlCommandType.UPDATE);


    private final String sqlPattern;

    private final SqlCommandType sqlCommandType;

    QueryType(final String sqlPattern, SqlCommandType sqlCommandType) {
        this.sqlPattern = sqlPattern;
        this.sqlCommandType = sqlCommandType;
    }

    public String getSqlPattern() {
        return sqlPattern;
    }

    public SqlCommandType getSqlCommandType() {
        return sqlCommandType;
    }
}
